<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="itd.db.DBConnection" %>
<%@ page import="itd.domain.Product" %>
<%@ page import="itd.domain.Shop" %>
<%@ page import="itd.domain.Item" %>
<%@ page import="java.math.BigDecimal" %>
<%@ page import="java.util.Vector" %>

<%
String id1 = request.getParameter("id1");
String id2 = request.getParameter("id2");

Product product1 = DBConnection.getProductDetail(new BigDecimal(id1));
Vector vItems1 = DBConnection.getItemsByProduct(new BigDecimal(id1));

Product product2 = DBConnection.getProductDetail(new BigDecimal(id2));
Vector vItems2 = DBConnection.getItemsByProduct(new BigDecimal(id2));

String app = request.getContextPath();

%>

<hr> <br>
	<table width="80%" align="center">
		<tr>
			<td colspan="4">		
			</td>
		</tr>
		<tr>
			<td>
			</td>
			<td>
				<p><img align="center" src="<%=app%>/<%=product1.getImagePath()%>" height="100" width="100"/></p>
			</td>
			<td>
			</td>
			<td>
				<p><img align="center" src="<%=app%>/<%=product2.getImagePath()%>" height="100" width="100"/></p>
			</td>
		</tr>
		<% for( int i = 0 ; i < vItems1.size() ; i++) { %>
			<%
				Item item1 = (Item) vItems1.get(i);
				Item item2 = (Item) vItems2.get(i);
			%>
			<tr>
				<td width="40%"><b><%=item1.getNombre()%></b></td>
		  		<td width="28%" align="center"><%=item1.getValor()%></td>
		  		<td width="1%">&nbsp;</td>
				<td width="28%" align="center"><%=item2.getValor()%></td>
		  	</tr>
		<% } %>
	</table>

</body>
</html>
